@extends('admin::layouts.master')
@section('content')
    <form action="{{route('article.update',$article['id'])}}" method="post">
        @csrf
        @method('PUT')
        <div class="card">
            <div class="card-header">
                编辑文章
            </div>
            <div class="card-body">
                <div class="form-group">
                    <label>文章标题</label>
                    <input type="text" class="form-control" name="title" value="{{$article['title']}}">
                </div>
                <div class="form-group">
                    <label>文章作者</label>
                    <input type="text" class="form-control" name="author" value="{{$article['author']}}">
                </div>

                <div class="form-group">
                    <label>文章内容</label>
                    <textarea class="form-control" name="content" rows="8">{{$article['content']}}</textarea>
                </div>

                <div class="form-group">
                    <label>点击数</label>
                    <input type="number" class="form-control" name="click" value="{{$article['click']}}">
                </div>

                <div class="form-check">
                    <input type="checkbox" class="form-check-input" value="1" @if($article['is_commend']) checked @endif name="is_commend">
                    <label class="form-check-label">是否推荐</label>
                </div>
            </div>
            <div class="card-footer text-muted">
                <button type="submit" class="btn btn-primary" style="width: 80px">进行编辑</button>
            </div>
        </div>
    </form>
    @endsection